<template>
  <div class="index">
    <page-search @on-query="handleQuery" @on-reset="handleRest" />
    <page-content ref="pageContentRef" @on-change="handleChange" />
    <page-modal ref="pageModalRef" />
  </div>
</template>

<script lang="ts" setup>
import pageSearch from './c-cpns/page-search.vue';
import pageContent from './c-cpns/page-content.vue';
import pageModal from './c-cpns/page-modal.vue';
import { ref } from 'vue';

const pageContentRef = ref<InstanceType<typeof pageContent>>();
const handleQuery = (payload: any) => {
  pageContentRef.value?.getpageTableList(payload);
};
const handleRest = () => {
  pageContentRef.value?.getpageTableList();
};

const pageModalRef = ref<InstanceType<typeof pageModal>>();

const handleChange = (payload: boolean, pageInfo?: any) => {
  console.log(pageInfo);
  pageModalRef.value?.handleChange(payload, pageInfo);
};
</script>

<style scoped lang="less"></style>
